/**
 * 菜单权限接口api
 */

// 引入拦截器
import instance from "@/utils/request";


// 分页获取菜单权限列表
export function getPermissionPageList(data = {}) {
    return instance.request({
        method: "post",
        url: "/user/list/page",
        data
    })
}

// 分页获取树形结构菜单权限
export function getMenuTreeList(data = {}) {
    return instance.request({
        method: "post",
        url: "/menu/tree/list",
        data
    })
}


// 分页获取树形结构菜单权限
export function getMenuPermission(data = {}) {
    console.log("数据：" , data)
    return instance.request({
        method: "post",
        url: "/permission/list/page",
        data
    })
}

// 菜单权限添加
export function addResource(data = {}) {
    console.log("菜单权限数据：" , data)
    return instance.request({
        method: "post",
        url: "/resource/add",
        data
    })
}

// 菜单权限详情查询，用于编辑回显
export function getResourceDetail(resourceId) {
    console.log("数据：",resourceId)
    return instance.request({
        method: "get",
        url: "/resource/get/" + resourceId
    })
}


// 菜单权限编辑
export function resourceEdit(data = {}) {
    console.log("编辑数据：" , data)
    return instance.request({
        method: "post",
        url: "/resource/edit",
        data
    })
}